import 'package:flutter/material.dart';
import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/index/iview/banner_iview.dart';
import 'package:flutter_deer/index/models/banner_entity.dart';
import 'package:flutter_deer/mvp/base_page_presenter.dart';
import 'package:flutter_deer/net/base_entity.dart';
import 'package:flutter_deer/net/net.dart';

class BannerPagePresenter extends BasePagePresenter<BannerIMvpView> {
  @override
  void initState() {}

  Future<dynamic> getBannerList() async {
    WidgetsBinding.instance.addPostFrameCallback((_) {
      asyncRequestNetwork<BaseEntity<List<BannerEntity>>>(Method.get,
          url: HttpApi.focusMapList, onSuccess: (data) {
        List<BannerEntity>? bannerList = data!.data;
        view.setBanners(bannerList);
      }, onError: (code, msg) {});
    });
  }
}
